﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>
<%
dim urls,id,page,content,tili,meili,repy,face,act,tid,vip
        urls=Request.QueryString("urls")
        if urls="" then urls="index.asp"

		if sid<>"Null" then
                Page = Request("Page")      '当前页数
    		If Page = "" Then Page = 1
   		If Not IsNumeric(Page) Then Page = 1
    		Page = CLng(Page)
                If Page < 1 Then Page = 1
                id=Request.QueryString("nid")
	        if id="" then id=qingtian.nid
	        if not isnumeric(id) then id=qingtian.nid
	        id=clng(id)
                tid=Request.QueryString("tid")
	        if tid="" then tid=0
	        if not isnumeric(tid) then tid=0
	        tid=clng(tid)
                face=trim(Request.form("face"))
                if face="" then face=0
	        if not isnumeric(face) then face=0
	        face=clng(face)
                content=qingtian.repsql(Request.form("content"))
                act=Request.QueryString("act")
if act=1 then
if qingtian.bbs=true or id=qingtian.nid then
set rs=Server.CreateObject("Adodb.Recordset")
			rs.open "select * from qingtian_kongjianly where id="&tid&"" ,conn,1,3
			if not (rs.bof and rs.eof) then
			rs.delete
			end if
			Rs.close
			set rs=nothing
end if
end if
                if len(content)>255 then content=""
Set Rs = Server.CreateObject("Adodb.Recordset")
Sql = "select [tili],[meili],[vip] from [qingtian_user] where [id]="&id
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof)  then                
                tili=rs("tili")
                meili=rs("meili")
                vip=rs("vip")
                end if
                Rs.close
                set rs=nothing

select case v
case "0"
we0="<br/>"
hr="-------------------<br/>"
Randomize()
book="跳到第<input name='Page' format='*N' size='2' maxlength='5'/><anchor>页<go href='myliuyan.asp?nid="&id&"&amp;sid="&sidd&"&amp;run="& Int((9999) * Rnd() + 1) &"' method='post'><postfield name=""Page"" value=""$(Page:n)"" /></go></anchor><br/>"

%>
<card title="我的留言"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
we1="</div>"
Randomize()
book=""&dao&"<form action=""myliuyan.asp?nid="&id&"&amp;sid="&sidd&"&run="& Int((9999) * Rnd() + 1) &""" method=""post"">跳到第<input type=""text"" name=""Page"" value="""" format=""*N"" size=""2"" maxlength=""5""/><input type=""submit"" value=""页"" /></form>"&we0&""

%>
<title>我的留言</title>
</head>
<body>
<!--#include virtual="/css.inc"-->
<%

End Select
 qingtian.info
if Request.QueryString("action")="save" and id=qingtian.nid then qingtian.err("不能对自己留言")
%>		
<%=qingtian.qingsav("343")%>
<%=sou%><a href="spacev.Asp?nid=<%=id%>&amp;sid=<%=sidd%>"><%=qingtian.name(id)%>的空间</a>>留言<%=we0%>
<%=dao%>==我的留言==<%=we0%><%=we%>
魅力:<%=zi%><%=meili%><%=zi0%>点,体力:<%=zi%><%=tili%><%=zi0%><br/><%=we0%>
<%if v=0 then %>
	<input emptyok="true"  type="text" name="content<%=RndTXT%>" size="15"/><br/><select title='表情' name='face' value='0'><option title='表情' value='0'>表情</option><option title='微笑' value='1'>微笑</option><option title='哭泣' value='2'>哭泣</option><option title='调皮' value='3'>调皮</option><option title='脸红' value='4'>脸红</option><option title='害羞' value='5'>害羞</option><option title='生气' value='6'>生气</option><option title='偷笑' value='7'>偷笑</option><option title='流汗' value='8'>流汗</option><option title='我倒' value='9'>我倒</option><option title='得意' value='10'>得意</option><option title='奸笑' value='11'>奸笑</option><option title='疑问' value='12'>疑问</option><option title='睡觉' value='13'>睡觉</option><option title='好色' value='14'>好色</option><option title='口水' value='15'>口水</option><option title='敲头' value='16'>敲头</option><option title='惊讶' value='17'>惊讶</option><option title='撇嘴' value='18'>撇嘴</option><option title='难过' value='19'>难过</option><option title='玫瑰' value='20'>玫瑰</option></select>
	<anchor>发表留言
    	<go href="myliuyan.Asp?nid=<%=id%>&amp;Action=save&amp;sid=<%=sidd%>" method='post'>
        <postfield name="content" value="$(content<%=RndTXT%>)"/>
        <postfield name="face" value="$(face)"/>
    	</go>
	</anchor><br/>
<%else%>
<form action="myliuyan.Asp?nid=<%=id%>&amp;Action=save&amp;sid=<%=sidd%>" method="post"><%=we%>
<textarea name="content" rows="2"/></textarea><%=we0%><select title='表情' name='face' value='0'><option title='表情' value='0'>表情</option><option title='微笑' value='1'>微笑</option><option title='哭泣' value='2'>哭泣</option><option title='调皮' value='3'>调皮</option><option title='脸红' value='4'>脸红</option><option title='害羞' value='5'>害羞</option><option title='生气' value='6'>生气</option><option title='偷笑' value='7'>偷笑</option><option title='流汗' value='8'>流汗</option><option title='我倒' value='9'>我倒</option><option title='得意' value='10'>得意</option><option title='奸笑' value='11'>奸笑</option><option title='疑问' value='12'>疑问</option><option title='睡觉' value='13'>睡觉</option><option title='好色' value='14'>好色</option><option title='口水' value='15'>口水</option><option title='敲头' value='16'>敲头</option><option title='惊讶' value='17'>惊讶</option><option title='撇嘴' value='18'>撇嘴</option><option title='难过' value='19'>难过</option><option title='玫瑰' value='20'>玫瑰</option></select>
<input type="submit" value="发表留言"/>
</form><br/>
<%end if%>
<%
Set Rs = Server.CreateObject("Adodb.Recordset")
Sql1 = "select [id],[namea],[nameb],[aid],[bid],[bnei],[repy],[dotime] from [qingtian_kongjianly] where aid="&id&" order by [id] desc"
		Rs.Open Sql1,conn,1,3
                if Request.form("action")=save and content<>"" then             
                if face<>0 then                
                content="[IMG]../IMG/"&face&".gif[/IMG]"&content
                end if
                rs.addnew
                rs("namea")=qingtian.name(id)
                rs("nameb")=session("username")
                rs("aid")=id
                rs("bid")=qingtian.nid()
                rs("bnei")=qingtian.repsql(content)
	        rs.update
                str=""&id&"tt你好,[url=spacev.asp?nid="&qingtian.nid&"&sid=[sid]]"&session("username")&"(ID:"&qingtian.nid&")[/url]在你的空间里发表了一条留言[url=myliuyan.asp?sid=[sid]]进入查看[/url]!"
                qingtian.addnfo(str)
                qingtian.addong("在[url=/user/spacev.asp?nid="&id&"&sid=[sid]]"&qingtian.name(id)&"的空间[/url]上留言")
                end if
		if not (rs.bof and rs.eof) then
				Rs.PageSize = 5	'一页N条记录
				IF Not IsEmpty(Page) Then
					IF Not IsNumeric(Page) Then		'判断Page是否为数字
						Page=1
					Else
						Page=Cint(Page)		'转换成短整形Integer
					End IF
					IF Page > Rs.PageCount Then
						Rs.AbsolutePage = Rs.PageCount	'设置当前显示页等于最后一页
					ElseIF Page <= 0 Then
						Rs.AbsolutePage = 1		'设置当前页等于第一页
					Else
						Rs.AbsolutePage = Page	'如果大于零,显示当前页等于接收的页数
					End IF
				Else
					Rs.AbsolutePage = 1
				End IF
				Page = Rs.AbsolutePage

        	For i=1 to  Rs.PageSize
		If Rs.Eof Then
			exit For
		End If
                If rs(6)<>"" Then
                repy=""&we&"主人回复:"&qingtian.ubb(rs(6))&""&we0&""
                else
if id=qingtian.nid then
if v=0 then 
book1="<input name='ton' size='15' maxlength='100'/><anchor>回复<go href='myliuyant.Asp?tid="&rs(0)&"&amp;sid="&sidd&"' method='post'><postfield name=""ton"" value=""$(ton)"" /></go></anchor><br/>"
else
book1=""&dao&"<form action=""myliuyant.Asp?tid="&rs(0)&"&amp;sid="&sidd&""" method=""post""><input type=""text"" name=""ton"" value="""" size=""15"" maxlength=""100""/><input type=""submit"" value=""回复"" /></form>"&we0&""
end if
else
book1=""
end if
                repy=book1
                End If
if qingtian.bbs=true or id=qingtian.nid then
repyt=".[<a href='myliuyan.asp?tid="&rs(0)&"&amp;act=1&amp;nid="&id&"&amp;page=" & Page & "&amp;sid="&sidd&"'>删除</a>]"
end if
dat=i+(page-1)*Rs.PageSize
            
dat1=dat mod 2
if dat1=0 then
%>			
<%=we%><%=dat%>.<a href="spacev.Asp?nid=<%=rs(4)%>&amp;sid=<%=sidd%>"><%=rs(2)%>(ID:<%=rs(4)%>)</a>:<%=qingtian.ubb(rs(5))%><%=repyt%><br/>[<%=rs(7)%>]<%=we0%><%=repy%>
<%
else
%>
<%=sou%><%=dat%>.<a href="spacev.Asp?nid=<%=rs(4)%>&amp;sid=<%=sidd%>"><%=rs(2)%>(ID:<%=rs(4)%>)</a>:<%=qingtian.ubb(rs(5))%><%=repyt%><br/>[<%=rs(7)%>]<%=we0%><%=repy%>
<%
End If
			
	 	Rs.MoveNext
	  	Next

           	If rs.PageCount > 1 Then
    		    %>
		<%=dao%>
		<%
    		End If
   		'分页
    		If Page < rs.PageCount Then
    		    Response.Write("<a href='myliuyan.asp?nid="&id&"&amp;page=" & Page + 1 & "&amp;sid="&sidd&"'>下一页</a>")
    		End If
       
    		If Page > 1 And Page < rs.PageCount Then
    		    Response.Write("|")
    		End If
        
    		If Page > 1 Then
    		    Response.Write("<a href='myliuyan.asp?nid="&id&"&amp;page=" & Page - 1 & "&amp;sid="&sidd&"'>上一页</a>"&we0&"")
    		Elseif rs.PageCount >1 then
    		    Response.Write we0
    		End If
            
    		Randomize()
    
    		If rs.PageCount > 2 Then
    		    %>
		<%=book%>
		<%
                 Response.Write("" & we & "[第"&Page&"/总"&rs.PageCount&"页/"&rs.RecordCount&"条]"&we0&"")
    		End If
		else
		response.write(""&we&"暂无留言"&we0&"")
		end if
		Rs.close

	set rs=nothing
%>
<%=hr%>
<%=qingtian.qingsav("344")%><%=sou%><a href="chuwu.asp?sid=<%=sidd%>">我的物品</a>|<a href="shangchen.asp?sid=<%=sidd%>">商场</a>|<a href="index.asp?sid=<%=sidd%>">地盘</a><%=we0%>                  <%

else
Response.Redirect "/login.asp?sid=" & sidd & "&url=/user/myliuyan.asp?sid="&sidd&"@@urls="&urls

end if

end Function
%>
